import request from '@/utils/request'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return request({ //  登录
    // url: '/login/login',
    url: '/api/auth/jwt/token', //  获取token
    method: 'post',
    data
  })
}

export function logout() { //  登出
  return request({
    // url: '/login/logout',
    url: '/api/auth/jwt/invalid',
    method: 'post'
  })
}

export function getUserInfo(token) { //  获取用户信息
  return request({
    // url: '/user/info',
    url: '/api/admin/user/front/info',
    method: 'get',
    params: { token }
  })
}

export function getMenus(token) { //  获取菜单
  return request({
    url: '/api/admin/user/front/menus',
    method: 'get',
    params: { token }
  })
}

